<?php
/*
Extension Name: Low-Cal Vanilla
Extension Url: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=315
Description: [experimental] Gunzip Vanilla pages.
Version: @@VERSION@@
Author: Dinoboff
Author Url: http://lussumo.com/community/account/2469/
*/
define('LOWCALVANILLA_DIR', dirname(__FILE__));
include_once(LOWCALVANILLA_DIR . '/Control.LowCalVanilla.php');
include_once(LOWCALVANILLA_DIR . '/Functions.php');

// Install setting value.
InstallLowCalVanilla($Context);

// Check the user browser support Is known for gzip issue.
// I am doing this check here and not in the LowCalVanilla controller
// because I might use this variable in other part of vanilla.
$Context->PassThruVars['LOWCALVANILLA_NOT_COMPATIBLE_CLIENT'] = IsGzipIncompatibleClient();

// Replace the 4 core script by a packed one
$Context->AddToDelegate('Head',
	'PreRender',
	'LowCalVanilla_PackJsFiles');

// add Low-Cal Vanilla control. Should be the last control to render.
$LowCalVanilla = new LowCalVanilla($Context);
$Page->AddControl('Page_Unload', $LowCalVanilla, '1000');